package ldh.serialize.type;

import java.io.IOException;

import ldh.serialize.BinarySerialized;
import ldh.serialize.io.ByteBuf;
import ldh.serialize.util.SerializedUtil;

public class StrSerialized implements BinarySerialized<String> {

	@Override
	public void write(ByteBuf out, String str) throws IOException {
		SerializedUtil.writeCompressString(out, str);
	}

	@Override
	public String read(ByteBuf in) throws IOException {
		return SerializedUtil.readCompressString(in);
	}

	@Override
	public Class<String> getClassType() {
		return String.class;
	}
}
